package cn.middle.swap.portal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.middle.swap.service.CallChainService;

@Controller
@RequestMapping("/callChain")
public class CallChainController {

	private final static String PREFIX = "swap/callChain/";

	@Autowired
	private CallChainService callChainService;

	@SaCheckPermission("callChain:list")
	@GetMapping("/list")
	public String list(@RequestParam(value = "page", defaultValue = "1") Integer pageNum,
			@RequestParam(value = "pageSize", defaultValue = "10") Integer limit, String messageId,
			String interfaceName, ModelMap modelMap) {
		modelMap.put("messageId", messageId);
		modelMap.put("interfaceName", interfaceName);
		modelMap.put("pageInfo", callChainService.listConditions(pageNum, limit, messageId, interfaceName));
		return PREFIX + "list";
	}
}
